import { fillText } from "@/utils/common"
export default class Text {
  constructor(x, y, value, key, color = 'black') {
    this.x = x
    this.y = y
    this.key = key
    this.value = value
    this.color = color
  }

  draw(ctx) {
    ctx.beginPath()
    ctx.fillStyle = this.color
    ctx.font = 'bold ' + (14 * window.devicePixelRatio) + 'px serif'
    fillText(ctx, this.value, this.x, this.y)
  }

  deepCopy() {
    return new Text(this.x, this.y, this.value, this.key, this.color)
  }
}